<?php $this->load->view('layout/header');?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <h3 class="page-title">网站设置<small> 推广专题管理</small></h3>
            <?php echo breadcrumb(array('网站设置', 'link/grid'=>'推广专题管理', '编辑推广专题管理')); ?>
        </div>
    </div>
    <?php echo execute_alert_message() ?>
    <div class="row-fluid">
        <div class="span12">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-plus-sign"></i>编辑友情链接</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <form class="form-horizontal line-form" action="<?php echo base_url('promotionproject/editPost') ?>" method="post" enctype="multipart/form-data">
                        <div class="control-group">
                            <label class="control-label"><em>* </em>专题名称</label>
                            <div class="controls">
                                <input type="hidden" name="id" value="<?php echo $promotion->id?>">
                                <input type="text" name="name" value="<?php echo $promotion->name?>" class="m-wrap large required">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><em>* </em>URL地址</label>
                            <div class="controls">
                                <input type="text" name="url" value="<?php echo $promotion->url?>" class="m-wrap large required url">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><em>* </em>图片添加</label>
                            <div class="controls">
                            <?php if (is_file($this->config->upload_image_thumb_path('promotion', $promotion->images))) :?>
                                <a href="<?php echo $this->config->show_image_thumb_url('promotion', $promotion->images)?>" target="__blank">
                                    <img src="<?php echo $this->config->show_image_thumb_url('promotion', $promotion->images)?>" width=150 height="100">
                                </a>
                                <input type="hidden" name="oldfilename" value="<?php echo $promotion->images ?>">
                                <input type="file" name="images">
                            <?php else : ?>
                                <input type="file" name="images" class="required">
                            <?php endif; ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><em>* </em>专题所属</label>
                            <div class="controls">
                                <select class="large m-wrap required" name="belong">
                                    <?php foreach ($belong as $key=>$value):?>
                                    <option value="<?php echo $key?>" <?php if ($key == $promotion->belong):?>selected="selected"<?php endif;?>><?php echo $value;?></option>
                                    <?php endforeach;?>
                                </select>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><em>* </em>专题来源</label>
                            <div class="controls">
                                <select class="large m-wrap required" name="version">
                                    <?php foreach ($version as $k=>$v):?>
                                    <option value="<?php echo $k?>" <?php if ($k == $promotion->version):?>selected="selected"<?php endif;?>><?php echo $v;?></option>
                                    <?php endforeach;?>
                                </select>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">点赞人数</label>
                            <div class="controls">
                                <input type="text" name="praise" value="<?php echo $promotion->praise?>" class="m-wrap large number">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">价格</label>
                            <div class="controls">
                                <input type="text" name="price" class="m-wrap large number" value="<?php echo $promotion->price?>" >
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">产品id</label>
                            <div class="controls">
                                <input type="text" name="item_id" class="m-wrap large number" value="<?php echo $promotion->item_id?>" >
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">小标题</label>
                            <div class="controls">
                                <input type="text" name="sub_name" class="m-wrap large" value="<?php echo $promotion->sub_name?>" >
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><em>* </em>排序</label>
                            <div class="controls">
                                <input type="text" name="sort" class="m-wrap large tooltips" value="<?php echo $promotion->sort?>" data-original-title="数字越小，排位越靠前" data-trigger="hover">
                            </div>
                        </div>
                        <div class="form-actions">
                            <button class="btn green" type="submit"><i class="icon-ok"></i> 保存</button>
                            <a href="<?php echo base_url('promotionproject/grid') ?>">
                                <button class="btn" type="button">返回</button>
                            </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('layout/footer');?>